import {defHttp} from '@/utils/http/axios';
import {userDetailParams,resetPwdParams} from "@/api/system/model/userModel";

enum Api {
  systemUserInfo = '/system/user',
  resetPwd = '/system/user/resetPwd'

}

export const getSystemUserInfo = (params: userDetailParams) =>
  defHttp.get({url: `${Api.systemUserInfo}/${params.id}`}, {isTransformResponse: false});


export const getPostsAndRoles = () =>
  defHttp.get({url: Api.systemUserInfo + "/"}, {isTransformResponse: false});


export const putUser = (data) =>
  defHttp.put({url: Api.systemUserInfo, data}, {isTransformResponse: false});

export const postUser = (data) =>
  defHttp.post({url: Api.systemUserInfo, data}, {isTransformResponse: false});


export const deleteUser = (userId) =>
  defHttp.delete({url: `${Api.systemUserInfo}/${userId}`}, {isTransformResponse: false});


//重置密码
export const resetPwd = (data:resetPwdParams) =>
  defHttp.put({url: Api.resetPwd, data}, {isTransformResponse: false});




